<template>
  <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="1"
      :page-sizes="pageSizes"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="maxTotal">
    </el-pagination>
  </div>
</template>

<script>
  export default {
    props: {
      maxTotal: {
        type: Number,
        default: 10
      },
      pageSize: {
        type: Number,
        default: 10
      },
      pageSizes: {
        type: Array,
        default () {
          return [10, 50, 100]
        }
      }
    },
    data () {
      return {}
    },
    methods: {
      handleSizeChange (val) {
        // 设置方法给组件里面的handleSize方法传参
        this.$emit('handleSize', val)
      },
      handleCurrentChange (val) {
        // 设置方法给组件里面的handleCurrent方法传参
        this.$emit('handleCurrent', val)
      }
    }
  }
</script>
